import React from 'react'
import { useSearchParams } from 'react-router-dom'
// import { useParams } from 'react-router-dom'
export default function Home() {
    //---------------SearchParams传参
    const [params] = useSearchParams()
    let id = params.get('id')
    let name = params.get('name')


    //---------------Params传参(需要修改router加占位符)
    // const params = useParams()
    // let id = params.id
    // let name = params.name

    return (
        <div>
            获取到的id为{id}-{name}
        </div>
    )
}
